﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;


namespace My3DGame
{
    static public class clsResourceHelper
    {
        #region Field

        static Game1 game;
        static ContentManager content;
        static List<Texture2D> introImages;
        static List<Texture2D> menuImages;
        #endregion End of Field

        #region Properties

       public static Game1 Game
       {
           get { return clsResourceHelper.game; }
           set 
           { 
               clsResourceHelper.game = value;
               clsResourceHelper.content = game.Content;
           }
       }

       public static ContentManager Content
       {
           get { return clsResourceHelper.content; }
           set { clsResourceHelper.content = value; }
       }

       public static List<Texture2D> IntroImages
       {
           get { return clsResourceHelper.introImages; }
           set { clsResourceHelper.introImages = value; }
       }


       public static List<Texture2D> MenuImages
       {
           get { return clsResourceHelper.menuImages; }
           set { clsResourceHelper.menuImages = value; }
       }

        #endregion end of Properties

       static public void LoadIntroImages()
       {
           try
           {
               introImages = new List<Texture2D>();
               // Load intro của nhóm
               introImages.Add(content.Load<Texture2D>(@"2DImages\Intro\GaLogo"));

               // Load image intro của game
               introImages.Add(content.Load<Texture2D>(@"2DImages\Intro\IntroBackground"));

               // Load image line
               introImages.Add(content.Load<Texture2D>(@"2DImages\Intro\LineL"));
               introImages.Add(content.Load<Texture2D>(@"2DImages\Intro\LineR"));
           }
           catch (Exception e)
           {
               clsErrorMsgHelper.WriteError("Cannot load Intro Background\nDetail:\n" + e.Message);
           }
       }

       static public void LoadMenuImages()
       {
           try
           {
               menuImages = new List<Texture2D>();
               // Load intro của nhóm
               menuImages.Add(content.Load<Texture2D>(@"2DImages\Menu\MainMenu"));
           }
           catch (Exception e)
           {
               clsErrorMsgHelper.WriteError("Cannot load menu images\nDetail:\n" + e.Message);
           }
       }
    }
}
